package com.chlitina.store.modules.cash.dao;

import java.util.List;

import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.chlitina.store.common.persistence.BaseDao;
import com.chlitina.store.common.persistence.BaseDaoImpl;
import com.chlitina.store.modules.cash.entity.StoreConsumeBuyProduct;

/**
 * StoreConsumeDAO接口
 * @author Songsong.Xu
 * @version 2013-11-07
 */
public interface StoreConsumeBuyProductDao extends StoreConsumeBuyProductDaoCustom, CrudRepository<StoreConsumeBuyProduct, Long> {
	@Modifying
	@Query("from StoreConsumeBuyProduct where EMPLOYEE_ID=?1")
	public List<StoreConsumeBuyProduct> findListByEmployee(long employeeID);
	
	@Modifying
	@Query("from StoreConsumeBuyProduct where CONSUME_ID=?1")
	public List<StoreConsumeBuyProduct> findListByConsume(long consumeID);
	
	
	@Modifying
	@Query("from StoreConsumeBuyProduct where PRODUCT_ID=?1")
	public List<StoreConsumeBuyProduct> findListByProduct(long productID);

}

/**
 * DAO自定义接口
 * @author Songsong.Xu
 */
interface StoreConsumeBuyProductDaoCustom extends BaseDao<StoreConsumeBuyProduct> {

}

/**
 * DAO自定义接口实现
 * @author Songsong.Xu
 */
@Component
class StoreConsumeBuyProductDaoImpl extends BaseDaoImpl<StoreConsumeBuyProduct> implements StoreConsumeBuyProductDaoCustom {

}
